package com.cn.test1.servlet;

import com.cn.test1.model.FootModel;
import com.cn.test1.model.HeadModel;
import com.cn.test1.model.HrModel;
import com.cn.test1.model.TopModel;
import com.cn.test1.service.FootService;
import com.cn.test1.service.HeadService;
import com.cn.test1.service.HrService;
import com.cn.test1.service.TopService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/hr")
public class HrServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        HrService hrService = new HrService();
        List<HrModel> hrModelList = hrService.getHrModel();
        req.setAttribute("hrModelList",hrModelList);
        //头部信息
        TopService TopService = new TopService();
        TopModel TopModel = TopService.getTopModel();
        req.setAttribute("TopModel",TopModel);
        //拿到导航信息
        List<TopModel> TopModelList = TopService.getTopModelList();
        req.setAttribute("TopModelList",TopModelList);

        //脚部信息
        FootService footService = new FootService();
        List<FootModel> footModel = footService.getFootModelList();//咨询信息
        req.setAttribute("footModel",footModel);

        List<FootModel> footModelInput = footService.getFootModelListInput();//输入框
        req.setAttribute("footModelInput",footModelInput);

        List<FootModel> footModelMessage = footService.getFootModelMessage();//留言提示信息
        req.setAttribute("footModelMessage",footModelMessage);

        FootModel footModels = footService.getFootModel();//备案信息
        req.setAttribute("footModels",footModels);

        List<FootModel> footModelListImg = footService.getFootModelListImg(); //底部图片
        req.setAttribute("footModelListImg",footModelListImg);

        req.getRequestDispatcher("/jsp/hr.jsp").forward(req,resp);

    }
}
